package com.xiguanlezz.cn.service;

import com.xiguanlezz.cn.OrderServiceGrpc;
import com.xiguanlezz.cn.OrderServiceProto;
import io.grpc.stub.StreamObserver;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/10/29 14:52
 * @Description：
 */
public class OrderServiceImpl extends OrderServiceGrpc.OrderServiceImplBase {

    @Override
    public void order(OrderServiceProto.OrderRequest request, StreamObserver<OrderServiceProto.OrderResponse> responseObserver) {
        OrderServiceProto.OrderResponse response = OrderServiceProto.OrderResponse
                .newBuilder()
                .setResult("下单成功！")
                .build();
        responseObserver.onNext(response);
        responseObserver.onCompleted();
    }
}
